﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/stylesheet.css")" rel="stylesheet" />
    <script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"></script>
    <script src="//ajax.aspnetcdn.com/ajax/jquery.ui/1.8.22/jquery-ui.min.js"></script>
    <script src="//cachedcommons.org/cache/jquery-bbq/1.2.1/javascripts/jquery-bbq-min.js"></script>
    <script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
    <script src="//ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.validate.unobtrusive.min.js"></script>
    <script src="//ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.unobtrusive-ajax.min.js"></script>
    <script src="//ajax.cdnjs.com/ajax/libs/modernizr/1.7/modernizr-1.7.min.js"></script>
    <script src="http://ajax.aspnetcdn.com/ajax/knockout/knockout-2.1.0.js"></script>
    <script src="@Url.Content("~/Scripts/jquery.json-2.3.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.utils.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.header.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.notifications.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/azuregames.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.data.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.dashboard.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.layout-manager.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.game-list.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.game.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.tile.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.info-pane.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.game-details.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.game-extend.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.game-playoptions.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.data.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.summary.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Debug/agames.pubsub.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.signalR-0.5.3.js")" type="text/javascript"></script>
    <script type="text/javascript" src="@Url.Content("~/signalr/hubs")"></script>
</head>
<body>
    <div class="header" id="header" data-url="@Url.RouteUrl("Dashboard")">
        <div>
            <div>
                <h1 data-title>
                    Dashboard</h1>
                <div class="nav">
                    @if (Request.IsAuthenticated)
                    {
                        if (Session["User"] != null)
                        {   
                        <span id="welcome">Welcome <span data-display-name>@(((AzureGames.Model.User)Session["User"]).Name)</span></span>
                        }
                        @:[ @Html.RouteLink("Dashboard", "Dashboard", null, new { id = "dashboard-link" })
                        @:| @Html.ActionLink("Profile", "Profile", "User")
                        @:| @Html.ActionLink("Log Out", "LogOut", "Account") ]
                    }
                    else
                    {
                        @:[ @Html.RouteLink("Dashboard", "Dashboard", null, new { id = "dashboard-link" })
                        @:| @Html.ActionLink("Log On", "LogOn", "Account") ]
                                            //@:| @Html.ActionLink("L1", "L1", "Account")
                        //@:| @Html.ActionLink("L2", "L2", "Account")
                        //@:| @Html.ActionLink("L3", "L3", "Account")                        
                    }
                    <img id="navEnvelope" src="@Url.Content("~/Content/Envelope.png")" alt="Messages" onclick="$('#notifications').notifications('ShowNotifications');" />
                </div>
            </div>
        </div>
    </div>
    <div id="notifications">
        <div id="content">        
        <div class="notification-source">
            <p>Notifications is currently loading...</p>
            <img src="@Url.Content("~/Content/ajax-loader.gif")" />
        </div>
        </div>
    </div>
    @RenderBody()
    @if (Request.IsAuthenticated)
    {
        <script type="text/javascript">
            // allowing the server to set the root URL for the site, 
            // which is used by the client code for server requests.
            $(function (agames) {
                agames.rootUrl = '@Url.Content("~")';
                agames.userID = '@(((AzureGames.Model.User)Session["User"]).ID)';
            } (this.agames = this.agames || {}));
        </script>
    }
    else
    {
        <script type="text/javascript">
            // allowing the server to set the root URL for the site, 
            // which is used by the client code for server requests.
            $(function (agames) {
                agames.rootUrl = '@Url.Content("~")';
                agames.userID = '00000000-0000-0000-0000-000000000000';
            } (this.agames = this.agames || {}));
        </script>
    }
    @RenderSection("Scripts", false)
</body>
</html>
